﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bank.Business.Components.Interfaces;
using Bank.Business.Entities;
using Bank.Business.Components.TransferOutcomeService;

namespace Bank.Business.Components
{
    public class OperationOutcomeService : IOperationOutcomeService
    {
        public void NotifyOperationOutcome(OperationOutcome pOutcome)
        {
            TransferOutcomeServiceClient lClient = new TransferOutcomeServiceClient();
            Boolean lOutcome = false;
            if(pOutcome.Outcome == OperationOutcome.OperationOutcomeResult.Successful)
            {
                lOutcome = true;
            }
            try
            {
                lClient.NotifyTransferOutcome(pOutcome.Message, lOutcome);
            }
            catch (Exception lException) { System.Diagnostics.Debug.Print(lException.Message); throw; }
        }
    }
}
